package org.joyflow.core.meta;

import java.io.Serializable;
import java.util.Properties;

public abstract class BaseDatabaseMeta implements DatabaseInterface {
    public static final int TYPE_ACCESS_NATIVE = 0;
    private Serializable id;
    private String name;
    private String hostname;
    private int accessType;
    private int port;
    private String databaseName;
    private String username;
    private String password;
    private Properties attributes;

    public BaseDatabaseMeta() {
        this.attributes = new Properties();
    }

    @Override
    public Serializable getId() {
        return this.id;
    }

    @Override
    public void setId(Serializable id) {
        this.id = id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getHostname() {
        return this.hostname;
    }

    @Override
    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    @Override
    public int getPort() {
        return this.port;
    }

    @Override
    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public String getURL(String hostname, String port, String databaseName) {
        return "";
    }

    @Override
    public String getUsername() {
        return this.username;
    }

    @Override
    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String getDriverClass() {
        return "";
    }

    @Override
    public int getAccessType() {
        return this.accessType;
    }

    @Override
    public void setAccessType(int accessType) {
        this.accessType = accessType;
    }

    @Override
    public Properties getAttributes() {
        return this.attributes;
    }

    @Override
    public void setAttributes(Properties attributes) {
        this.attributes = attributes;
    }

    @Override
    public String getDatabaseName() {
        return this.databaseName;
    }

    @Override
    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    @Override
    public Object clone() {
        BaseDatabaseMeta retval = null;
        try {
            retval = (BaseDatabaseMeta) super.clone();
            retval.attributes = (Properties) attributes.clone();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
        return retval;
    }

}
